function s = sigmasqonximix

s.sq1k = @sq1k;

s.sqij = @sqij;

function y = Ak(k,T)
y = sqrt(2/T)/(1+((k-1)*pi/T)^2);

function y = Bk(k,T)
y = (k-1)*pi/T;

function y = sq1k(k,t,T) % checked
y = 2*((Ak(k,T)*(2/exp(T) - 1/exp(2*T) - 2./exp(t) + 1./exp(2*t) ...
    - 2*cos(Bk(k,T)*T) + 2*cos(Bk(k,T)*t) - (2*cos(Bk(k,T)*t))./exp(t) ...
    + (2*cos(Bk(k,T)*T))/exp(T)))/(2*T^(1/2)) + (Ak(k,T)*(2*sin(Bk(k,T)*T) ...
    - 2*sin(Bk(k,T)*t)))/(2*Bk(k,T)*T^(1/2)));


function y = sqij(i,j,t,T)   % checked

y = 2*(-(Ak(i,T)*Ak(j,T)*(Bk(i,T)^2/exp(2*T) - Bk(j,T)^2/exp(2*T) ...
    - Bk(i,T)^2./exp(2*t) + Bk(j,T)^2./exp(2*t) ...
    + Bk(i,T)^2*(2*cos(Bk(i,T)*T)*cos(Bk(j,T)*T) ...
    - 2*cos(Bk(i,T)*t).*cos(Bk(j,T)*t)) + (Bk(i,T)^2*(2*cos(Bk(i,T)*t) ...
    + 2*cos(Bk(j,T)*t)))./exp(t) - (Bk(j,T)^2*(2*cos(Bk(i,T)*t) ...
    + 2*cos(Bk(j,T)*t)))./exp(t) - 2*Bk(j,T)^2*cos(Bk(i,T)*T)*cos(Bk(j,T)*T) ...
    - (Bk(i,T)^2*(2*cos(Bk(i,T)*T) + 2*cos(Bk(j,T)*T)))/exp(T) ...
    + (Bk(j,T)^2*(2*cos(Bk(i,T)*T) + 2*cos(Bk(j,T)*T)))/exp(T) ...
    + 2*Bk(j,T)^2*cos(Bk(i,T)*t).*cos(Bk(j,T)*t) ...
    + 4*Bk(i,T)*Bk(j,T)*cosh(log(Bk(i,T)))*cos(Bk(i,T)*T)*sin(Bk(j,T)*T) ...
    - 4*Bk(i,T)*Bk(j,T)*cosh(log(Bk(j,T)))*cos(Bk(j,T)*T)*sin(Bk(i,T)*T) ...
    - 4*Bk(i,T)*Bk(j,T)*cosh(log(Bk(i,T)))*cos(Bk(i,T)*t).*sin(Bk(j,T)*t) ...
    + 4*Bk(i,T)*Bk(j,T)*cosh(log(Bk(j,T)))*cos(Bk(j,T)*t).*sin(Bk(i,T)*t)))/(2*(Bk(i,T)^2 ...
    - Bk(j,T)^2)));
